package com.visizen.wisdomclass.server.client;

import com.visizen.wisdomclass.server.model.WcClassTalk;
import com.visizen.wisdomclass.server.model.WcClassTalkExample;
import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.DeleteProvider;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectProvider;
import org.apache.ibatis.annotations.Update;
import org.apache.ibatis.annotations.UpdateProvider;
import org.apache.ibatis.type.JdbcType;

public interface WcClassTalkMapper {
    @SelectProvider(type=WcClassTalkSqlProvider.class, method="countByExample")
    int countByExample(WcClassTalkExample example);

    @DeleteProvider(type=WcClassTalkSqlProvider.class, method="deleteByExample")
    int deleteByExample(WcClassTalkExample example);

    @Delete({
        "delete from wc_class_talk",
        "where MESS_ID = #{MESS_ID,jdbcType=BIGINT}"
    })
    int deleteByPrimaryKey(Long MESS_ID);

    @Insert({
        "insert into wc_class_talk (MESS_ID, CIRCLE_ID, ",
        "USER_ID, TYPE, CONTENT, ",
        "TIME, SOURCE_ID)",
        "values (#{MESS_ID,jdbcType=BIGINT}, #{CIRCLE_ID,jdbcType=BIGINT}, ",
        "#{USER_ID,jdbcType=BIGINT}, #{TYPE,jdbcType=INTEGER}, #{CONTENT,jdbcType=VARCHAR}, ",
        "#{TIME,jdbcType=TIMESTAMP}, #{SOURCE_ID,jdbcType=BIGINT})"
    })
    int insert(WcClassTalk record);

    @InsertProvider(type=WcClassTalkSqlProvider.class, method="insertSelective")
    int insertSelective(WcClassTalk record);

    @SelectProvider(type=WcClassTalkSqlProvider.class, method="selectByExample")
    @Results({
        @Result(column="MESS_ID", property="MESS_ID", jdbcType=JdbcType.BIGINT, id=true),
        @Result(column="CIRCLE_ID", property="CIRCLE_ID", jdbcType=JdbcType.BIGINT),
        @Result(column="USER_ID", property="USER_ID", jdbcType=JdbcType.BIGINT),
        @Result(column="TYPE", property="TYPE", jdbcType=JdbcType.INTEGER),
        @Result(column="CONTENT", property="CONTENT", jdbcType=JdbcType.VARCHAR),
        @Result(column="TIME", property="TIME", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="SOURCE_ID", property="SOURCE_ID", jdbcType=JdbcType.BIGINT)
    })
    List<WcClassTalk> selectByExample(WcClassTalkExample example);

    @Select({
        "select",
        "MESS_ID, CIRCLE_ID, USER_ID, TYPE, CONTENT, TIME, SOURCE_ID",
        "from wc_class_talk",
        "where MESS_ID = #{MESS_ID,jdbcType=BIGINT}"
    })
    @Results({
        @Result(column="MESS_ID", property="MESS_ID", jdbcType=JdbcType.BIGINT, id=true),
        @Result(column="CIRCLE_ID", property="CIRCLE_ID", jdbcType=JdbcType.BIGINT),
        @Result(column="USER_ID", property="USER_ID", jdbcType=JdbcType.BIGINT),
        @Result(column="TYPE", property="TYPE", jdbcType=JdbcType.INTEGER),
        @Result(column="CONTENT", property="CONTENT", jdbcType=JdbcType.VARCHAR),
        @Result(column="TIME", property="TIME", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="SOURCE_ID", property="SOURCE_ID", jdbcType=JdbcType.BIGINT)
    })
    WcClassTalk selectByPrimaryKey(Long MESS_ID);

    @UpdateProvider(type=WcClassTalkSqlProvider.class, method="updateByExampleSelective")
    int updateByExampleSelective(@Param("record") WcClassTalk record, @Param("example") WcClassTalkExample example);

    @UpdateProvider(type=WcClassTalkSqlProvider.class, method="updateByExample")
    int updateByExample(@Param("record") WcClassTalk record, @Param("example") WcClassTalkExample example);

    @UpdateProvider(type=WcClassTalkSqlProvider.class, method="updateByPrimaryKeySelective")
    int updateByPrimaryKeySelective(WcClassTalk record);

    @Update({
        "update wc_class_talk",
        "set CIRCLE_ID = #{CIRCLE_ID,jdbcType=BIGINT},",
          "USER_ID = #{USER_ID,jdbcType=BIGINT},",
          "TYPE = #{TYPE,jdbcType=INTEGER},",
          "CONTENT = #{CONTENT,jdbcType=VARCHAR},",
          "TIME = #{TIME,jdbcType=TIMESTAMP},",
          "SOURCE_ID = #{SOURCE_ID,jdbcType=BIGINT}",
        "where MESS_ID = #{MESS_ID,jdbcType=BIGINT}"
    })
    int updateByPrimaryKey(WcClassTalk record);
}